<template>
  <div class="me-banner">
    <swiper :options="swiperOption">
      <slot></slot>
      <div class="swiper-pagination" slot="pagination"></div>
    </swiper>
  </div>
</template>
<script>
export default {
  name: 'meBanner',
  props: {
    loop: {
      type: Boolean,
      default: false
    },
    direction: {
      type: String,
      validator (value) {
        return ['horizontal', 'vertical'].indexOf(value) > -1
      },
      default: 'horizontal'
    },
    autoplay: {
      type: Number,
      default: 0
    },
    speed: {
      type: Number,
      default: 300
    }
  },
  created () {
    this.swiperOption = {
      loop: this.loop,
      direction: this.direction,
      autoplay: this.autoplay,
      speed: this.speed,
      pagination: {
        el: '.swiper-pagination'
      }
    }
  }
}
</script>
<style lang="stylus" scoped>
</style>
